2D Visualization Example¶

Outline¶

2D Visualization Class

Lidar Visualization

Annotations Visualizations

Combined Visualization

Loading frame information¶

This step is required to use the frame transformations class. The content of this snippet is explained in Notebook 1.

In [1]:
from vod_frame import KittiLocations
from vod_frame import FrameDataLoader


kitti_locations = KittiLocations(root_dir="example_set",
                                output_dir="example_output")

frame_data = FrameDataLoader(kitti_locations=kitti_locations,
                             frame_number="01201")

2D Visualization class¶

The Visualization2D class allows the projection of the lidar, radar data, and the 3D-boxes of the annotation to the camera picture. The example below shows the instantiation of the class, and applies the generate_frame_picture() to plot the picture.

In [2]:
from vod_visualization import Visualization2D

vis2d = Visualization2D(frame_data)

vis2d.generate_frame_picture()

LIDAR point-cloud visualization¶

By changing the arguments of the generate_frame_picture() method, plotting lidar points is also possible.

In [3]:
vis2d.generate_frame_picture(is_lidar_pcl_plot=True)

Radar point-cloud visualization¶

Similar to Lidar, provided is_radar_pcl_plot=True argument, the radar pcl can be also plotted over the picture.

In [4]:
vis2d.generate_frame_picture(is_radar_pcl_plot=True)

Annotation visualization¶

Similar to point-cloud data, the 3D bounding boxes can be also plotted over the picture.

In [5]:
vis2d.generate_frame_picture(is_gt_plot=True)

2D Combined sensors and filters¶

Plotting the point-clouds and the annotations in a single plot is also possible. It is also possible to set filters for distance, which limits the number of plotted instances. Using the save_figure argument, it is possible to save the image to a file as well.

In [6]:
vis2d.generate_frame_picture(is_lidar_pcl_plot=True,
                             is_radar_pcl_plot=True,
                             is_gt_plot=True,
                             min_distance_threshold=5,
                             max_distance_threshold=20,
                             save_figure=True)
In [7]:
import os

os.system('jupyter nbconvert --to html 3_2d_visualization.ipynb')
Out[7]:
0
In [ ]: